package com.idheima.zuoye.zuoye4;

import java.io.*;

public class Test {
    public static void main(String[] args) throws IOException {
        try {
            FileInputStream fis = new FileInputStream(new File("D:\\java-base-ws" +
                    "\\JavaAdvanceProject" +
                    "\\day12_IO_zifuji\\src\\" +
                    "com\\idheima\\IO\\aikun"));
            //读取文件中的字节数据
            FileOutputStream fos = new FileOutputStream(new File("D:\\java-base-ws" +
                    "\\JavaAdvanceProject" +
                    "\\day12_IO_zifuji\\src\\" +
                    "com\\idheima\\IO\\aikun2"));


            int len;

            byte[] bytes = new byte[1024];
            //加密
          //  byte key = 0x55;

            while ( (len = fis.read(bytes) ) != -1) {
                for (int i = 0; i < len; i++) {
                   // bytes[i] =(byte) (bytes[i] ^ key);
                fos.write(bytes[i]+1);
                }
            }

            System.out.println("拷贝完毕");
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

    }

}
